package dao.oc_sea_area_ben;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import entitybean.oc_sea_area.EntityBeanOc_Sea_Area;
import entitybean.oc_sea_area_ben.EntityBeanOc_Sea_Area_Ben;
public class DaoImpl_Oc_Sea_Area_Ben  extends HibernateDaoSupport implements Dao_Oc_Sea_Area_Ben{
	public void Insert_Oc_Sea_Area_Ben(EntityBeanOc_Sea_Area_Ben e)
	{
		this.getHibernateTemplate().save(e);
	}
	public void Update_Oc_Sea_Area_Ben(EntityBeanOc_Sea_Area_Ben e)
	{
		this.getHibernateTemplate().update(e);
	}
	public void Delete_Oc_Sea_Area_Ben(EntityBeanOc_Sea_Area_Ben e)
	{
		this.getHibernateTemplate().delete(e);
	}
	public void Delete_Oc_Sea_Area_Ben(String id)
	{
		List<EntityBeanOc_Sea_Area_Ben> list=this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Ben where del='OFF' and id in("+id+")");	
		for(int i=0;i<list.size();i++)
		{
			EntityBeanOc_Sea_Area_Ben e=list.get(i);
			e.setDel("ON");
			this.getHibernateTemplate().update(e);
			
		}
		
	}
	@SuppressWarnings("unchecked")
	public List<EntityBeanOc_Sea_Area_Ben> Find_Oc_Sea_Area_Ben_BY_ID(Integer id)
	{
		return this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Ben where id="+id);
	}
	public List<EntityBeanOc_Sea_Area_Ben> Find_Oc_Sea_Area_Ben_ISACTIVE()
	{
		
		return this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Ben where del='OFF'");
	}
}
